package cn.jiyun.controller;

//import cn.jiyun.common.AutoLogs;
import cn.jiyun.common.config.Result;
import cn.jiyun.pojo.Ffw;
import cn.jiyun.pojo.Fw;
import cn.jiyun.service.FfwService;
import cn.jiyun.service.GxiService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("ffw")
@CrossOrigin
public class FfwController {
    @Autowired
    private FfwService ffwService;
    @Autowired
    private GxiService gxiService;

    @RequestMapping("findPage1")
    public Result findPage1(Integer pageNum, Integer pageSize, @RequestBody Ffw ffw){
        Page page=ffwService.findPage1(pageNum,pageSize,ffw);
        return Result.ok(page);
    }

    @RequestMapping("gxList")
    public Result gxList(){
        return Result.ok(gxiService.list());
    }



    @RequestMapping("/add1")
    public Result add1(@RequestBody Ffw ffw){
        ffw.setJjlx(1);
        ffwService.save(ffw);
        return Result.ok();
    }


    @RequestMapping("deleteById1")
    public Result deleteById1(Integer id){
        ffwService.removeById(id);
        return Result.ok();
    }








}
